﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="WorkFlow_WFDesigner_LineEdit" ValidateRequest="false" Codebehind="LineEdit.aspx.cs" %>
<%@ Import Namespace="Honestysoft.Workflow.Model" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>编辑连接</title>
    <base target="_self" />
       <meta http-equiv="Pragma" content="no-cache" />
       <meta http-equiv="Cache-Control" content="no-cache"/>
       <meta http-equiv="Expires" content="0"/> 
    <link href="../css/tab/tab.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/control.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="../js/WFWinCtrlScript.js"></script>
    <script language="javascript" type="text/javascript" src="../css/tab/tab.js"></script>
    <script language="javascript" type="text/javascript">
    function HiddenLi1(bool)
    {
        if(bool == true)
        {
            li1.style.display="none";
        }
        else
        {
            li1.style.display="block";
        }
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
 <div class="page_margin" style="margin:5px"> 
  <div class="nTab_l">

    <div class="TabTitle_l">
      <ul id="myTab_l">     
        <li id='li0' class="active" onclick="nTabs(this,0);">基本信息</li> 
        <li id='li1' class="normal" onclick="nTabs(this,1);">条    件</li> 
      </ul>
    </div>

    <div class="TabContent_l" style="height:220px;overflow-y:hidden">
    
        <div id="myTab_l_Content0" >
            <table width="98%" border="1" cellpadding="0" cellspacing="0" class="tEdit">
                <tr>
                    <td>
                        连接名称：</td>
                    <td colspan="3">
                        <asp:TextBox ID="txtName" runat="server" Width="98%" CssClass="input2"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>
                        开始节点：</td>
                    <td>
                        <asp:DropDownList ID="ddlsActTemplateID" runat="server" Width="98%" CssClass="input2" OnSelectedIndexChanged="ddlsActTemplateID_SelectedIndexChanged" AutoPostBack="True">
                        </asp:DropDownList></td>
                    <td>
                        结束节点：</td>
                    <td>
                        <asp:DropDownList ID="ddleActTemplateID" runat="server" Width="98%" CssClass="input2">
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td>
                        描 &nbsp; &nbsp; &nbsp;&nbsp; 述：</td>
                    <td colspan="3">
                        <asp:TextBox ID="txtDescription" runat="server" Rows="4" TextMode="MultiLine" Width="98%" CssClass="input2"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>
                        创建时间：</td>
                    <td>
                        <asp:Label ID="lblCreatedTime" runat="server" ></asp:Label></td>
                    <td>
                        修改时间：</td>
                    <td>
                        <asp:Label ID="lblUpdatedTime" runat="server" ></asp:Label></td>
                </tr>
                <tr>
                    <td colspan="4">
                        <fieldset >
                        <legend>路由类型</legend>
                        <asp:RadioButtonList ID="rblrelationType" runat="server" Width="98%" RepeatLayout="Flow">
                        </asp:RadioButtonList></fieldset>
                    </td>
                </tr>
            </table>
        </div>

        <div id="myTab_l_Content1" class="none" style="height:600;overflow-y:hidden" align="center" >
         
         <div align="right" class="button_area"> 
     <asp:Button ID="btnAddConditon" Text="新增" runat="server" OnClientClick="return AddCondition();" OnClick="btnAddConditon_Click"  class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'"/> 
      <asp:Button ID="btnDelCondition" Text="删除" OnClick="btnDelCondition_Click"   runat="server"  class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'"/>      
    </div>
<div style="width:100%;overflow:scroll;height:200px">
<table width="98%"  border="1" cellspacing="0" cellpadding="1" class="t1">
  <thead>
    <th style="width:30px" align="center" >
        <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:mCheckAll(this,"chkID")' />
    </th>
    <th style="width:30px" align="center">组号</th>		
	<th align="center">变量名称</th>	
	<th align="center">运算符</th>	
	<th align="center">变量值</th>	
	<th align="center">关系</th>	
	<th style="width:80px" align="center">操作</th>
  </thead>
  
  <asp:Repeater ID="repWF_Condition" runat="server" >
  <ItemTemplate>
  <tr>
<td align="center" >
        <input type="checkbox" name="chkID" id="chk<%# DataBinder.Eval(Container.DataItem,"ID") %>"  value="<%# DataBinder.Eval(Container.DataItem,"ID") %>" >
    </td>
    <td align="center"><%# DataBinder.Eval(Container.DataItem, "RelationSerial")%></td>	
	<td align="left"><%# GetVarName(DataBinder.Eval(Container.DataItem, "VarID")+"")%></td>	
	<td align="center"><%# WFPublicFun.GetEnumText(typeof(WFEnumData.OperatorType), DataBinder.Eval(Container.DataItem, "Operator")+"")%></td>	
	<td align="left"><%# GetVarValue(DataBinder.Eval(Container.DataItem, "VarID")+"", DataBinder.Eval(Container.DataItem, "VarValue")+"")%></td>	
	<td align="center"><%# WFPublicFun.GetEnumText(typeof(WFEnumData.LogicRelation), DataBinder.Eval(Container.DataItem, "Relation")+"")%></td>	
<td align="center">
	<%# WorkflowApply.WFScript.GetDataItemDeleteButton(DataBinder.Eval(Container.DataItem,"ID")+"",btnDelCondition) %>
</td>
  </tr>  
  </ItemTemplate>
  </asp:Repeater>
  
</table>
  </div>             
<asp:HiddenField ID="hiCondition" runat="server" />
               
        </div>
        
    </div>

  </div>
</div>    

<table width="100%"  border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td align="center">
        <asp:Button ID="btnSave" Text = "保存" runat="server"  OnClick="btnSave_Click"   class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'"/>
        <asp:Button ID="btnExit" Text = "退出" runat="server" OnClientClick="window.close();"   class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'"/>
    </td>
  </tr>
</table>
<input type="hidden" id="HidID" runat="server" style="width:0px" />
<input type="hidden" id="HidProjectID" runat="server" style="width:0px"/>
<input type="hidden" id="HidJobTemplateID" runat="server" style="width:0px"/>
<input type="hidden" id="HidNodeKey" runat="server" style="width:0px"/>

 <input type="hidden" id="HidFlowXML" name="FlowXML" runat="server" style="width:0px" />

    </form>
    <script language="javascript" type="text/javascript">
    var opener = window.dialogArguments;
    var url = opener.dialogURL;
    var xmlflow = opener.document.all.FlowXML;
    document.getElementById("<%=HidFlowXML.ClientID %>").value=xmlflow.value;   
 
    function AddCondition()
    {
        var Url ='<%= WorkflowApply.Home %>WorkFlow/WFDesigner/ConditionEdit.aspx?JobTemplateID=<%= Request["JobTemplateID"]+"" %>';
        var retValue = mOpenDlgReturnObj(Url,560,300,"<%=WorkflowApply.Home%>","新增条件变量");
        if(retValue == null)
        {
            return false;
        }
        var condStr =retValue.ID+"|"+retValue.RelationSerial+"|"+retValue.VarID+"|"+retValue.Operator+"|"+retValue.VarValue+"|"+retValue.Relation;
        document.getElementById("<%=hiCondition.ClientID %>").value=condStr;
        return true;
    }
    
    </script>
</body>
</html>
